from calibre.web.feeds.recipes import BasicNewsRecipe
     
class Git_Pocket_Guide(BasicNewsRecipe):
     
    title = '鸟哥的 Linux 私房菜 -- 服务器架设篇目录'
    description = ''
    cover_url = 'http://images.99read.com/newProduct/71/600.600/a0000353816.jpg'
     
    url_prefix = 'http://vbird.dic.ksu.edu.tw/linux_server/'
    no_stylesheets = True
    # keep_only_tags = [{ 'class': 'span-21' }]
     
    def get_title(self, link):
        return link.contents[0].strip()
     
    def parse_index(self):
        soup = self.index_to_soup(self.url_prefix)
         
        div = soup.find('td')
         
        articles = []
        for link in div.findAll('a'):
         
            til = self.get_title(link)
            url = link['href']
            a = { 'title': til, 'url': url }
         
            articles.append(a)
         
        ans = [('鸟哥的 Linux 私房菜 -- 服务器架设篇目录', articles)]
         
        return ans